package com.situ.day1;

import org.junit.Test;

public class Operator {

	@Test
	public void test1() {
		int num1 = 3;
		int num2 = 5;
		int result = num1 + num2;
		System.out.println(result);
		System.out.println(8 / 2);//商 4
		System.out.println(8 % 2);//余数 0
		System.out.println( 8 / 3);//商 2
		System.out.println( 8 % 3);//余数 2
		System.out.println( 2 / 7);//商 0
		System.out.println( 2 % 7);//余数 2
	}
	
	@Test
	public void test2() {
		System.out.println(3 >= 5);//false
		System.out.println(5 <= 10);//true
		
		int num1 = 57;
		int num2 = 400;
		boolean bool = (num1 >= 60) && (num2 >= 400);
		System.out.println(bool);
	}
	
	@Test
	public void test4() {
		//int i = 0;
		//i++; //i = i + 1;
		//++i; //i = i + 1;
		
		int i = 3;
		i++; // ++i;
		System.out.println(i);//4
		System.out.println(i++);//4 (i=5)
		System.out.println(++i);//6 (i=6)
	}
	
	@Test
	public void test44() {
		int num1 = 3;
		int num2 = 5;
		// && 短路
		System.out.println(num1 < 0 && num1++ < num2);//false
		System.out.println(num1);//3
		System.out.println(num2);//5
		// || 短路
		System.out.println(num1 > 0 || num1++ < num2);//true
		System.out.println(num1);//3
		System.out.println(num2);//5
	}
	
}
